<!DOCTYPE html>
<html lang='en'>

<head>
  <meta charset='UTF-8'>
  <meta http-equiv='X-UA-Compatible' content='IE=edge'>
  <meta name='viewport' content='width=device-width, initial-scale=1.0'>
  <title>Document</title>
  <script src='https://cdn.jsdelivr.net/npm/vue/dist/vue.js'></script>
</head>

<body>
  <template id="faCpn">
    <div>
      <h2>{{fMessage}}</h2>
      <ch-cpn></ch-cpn>
      <ch-cpn></ch-cpn>
      <ch-cpn></ch-cpn>
    </div>
  </template>
  <template id="chCpn">
    <div>
      <input type="text" v-model="chMessage">
    </div>
  </template>
  <div id='app'>
    <h2>{{message}}</h2>
    <fa-cpn></fa-cpn>
  </div>
  <script>
    let obj = {
      chMessage: '我是孩子'
    }
    Vue.component('faCpn', {
      template: '#faCpn',
      data() {
        return {
          fMessage: '我是父亲'
        }
      },
      components: {
        'chCpn': {
          template: '#chCpn',
          data() {
            return obj
          }
        }
      }
    })
    const app = new Vue({
      el: '#app',
      data: {
        message: 'hello world'
      }
    })
  </script>
</body>

</html>